class DataInfoFigure {
    getOpinionTrendChart(_data) {
        let option = {};
        let _series = [];
        let _legend = [];
        if (_data.data.length > 0) {
            _data.data.forEach((cValue) => {
                cValue['type'] = 'line';
                cValue['smooth'] = true;
                cValue['symbol'] = 'none';
                _legend.push(cValue.name);
                _series.push(cValue);
            });

            option = {
                tooltip: {
                    trigger: 'axis',
                    showContent: true,
                    axisPointer: {
                        type: 'line',
                        label: {
                            backgroundColor: '#6a7985'
                        }
                    }
                },
                legend: {
                    data: _legend,
                    bottom: 0,
                    icon: 'rect',
                    itemWidth: 8,
                    itemHeight: 6,
                    itemGap: 20
                },
                color: ['#5D69BA', '#F3876F', '#9E8DE4', '#5DA1BA', '#3B8FE5', '#7AB990', '#74ADE7', '#EEA367', '#E4C375', '#ACB0CC', '#F76C9D', '#7A87B9'],
                grid: {
                    left: '0',
                    right: '4%',
                    top: 10,
                    bottom: 90,
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: _data.dates,
                    axisLine: {
                        lineStyle: {
                            color: '#757679'
                        }
                    }
                },
                yAxis: {
                    type: 'value',
                    minInterval: 1,
                    splitLine: {
                        show: false
                    },
                    axisLine: {
                        lineStyle: {
                            color: '#757679'
                        }
                    }
                },
                series: _series
            }
        }

        return option;
    }
}
export default new DataInfoFigure()